package com.hunt.model.entity;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.ToString;

@AllArgsConstructor
@NoArgsConstructor
@ToString
public class MainDateNew {
    private String serialNumber;
    private String stockCode;
    private String name;

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public String getStockCode() {
        return stockCode;
    }

    public void setStockCode(String stockCode) {
        this.stockCode = stockCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOwnFundNumber() {
        return ownFundNumber;
    }

    public void setOwnFundNumber(String ownFundNumber) {
        this.ownFundNumber = ownFundNumber;
    }

    public String getHoldingNumber() {
        return holdingNumber;
    }

    public void setHoldingNumber(String holdingNumber) {
        this.holdingNumber = String.valueOf(Math.round(Double.parseDouble(holdingNumber)/10000));
    }

    public String getHoldingStockValue() {
        return holdingStockValue;
    }

    public void setHoldingStockValue(String holdingStockValue) {
        this.holdingStockValue = String.format("%.2f", Double.parseDouble(holdingStockValue)/100000000);
    }

    public String getHoldingChangeValue() {
        return holdingChangeValue;
    }

    public void setHoldingChangeValue(String holdingChangeValue) {
        this.holdingChangeValue = String.valueOf(Math.round(Double.parseDouble(holdingChangeValue)/10000));
    }

    public String getHoldingChangeRate() {
        return holdingChangeRate;
    }

    public void setHoldingChangeRate(String holdingChangeRate) {
        this.holdingChangeRate = holdingChangeRate;
    }

    public String getHoldingChangeStatus() {
        return holdingChangeStatus;
    }

    public void setHoldingChangeStatus(String holdingChangeStatus) {
        this.holdingChangeStatus = holdingChangeStatus;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        if("增仓".equals(type)){
            this.type = "0";
        }
        else {
            this.type = "1";
        }
    }

    private String ownFundNumber;
    private String holdingNumber;
    private String holdingStockValue;
    private String holdingChangeValue;
    private String holdingChangeRate;
    private String holdingChangeStatus;
    private String type;
}

